# general
snippet l "console.log"
console.log('$1');
endsnippet

snippet e "console.error"
console.error('$1');
endsnippet


# es6
snippet p "Promise ES6 style"
new Promise((r, errback) => {
  $1
});
endsnippet

snippet ps "Promise ES6 single line style"
new Promise((r, errback) => r(); $1)
endsnippet

snippet (err) "Arrow function with Error object"
(err) => {
  if (err) return done(err);
}
endsnippet

snippet () "Arrow function"
($1) => {
  $2
}
endsnippet

snippet import "Import"
import $1 from '$2';
endsnippet

snippet class
class ${1:name} {
  constructor(${2:arg}) {
    ${3:// init}
  }
  ${4}
}
endsnippet

# node
snippet #! "shebang"
#!/usr/bin/env node
endsnippet

snippet ex "module.exports"
module.exports = ${1};
endsnippet


snippet stdout "stdout"
process.stdout
endsnippet

snippet stdin "stdin"
process.stdin
endsnippet

snippet stderr "stderr"
process.stderr
endsnippet

